<%@page import="cz.acies.data.process.UserProcessor"%>
<%@ page import="cz.acies.data.*"%>
<%@ page import="cz.acies.data.persist.*"%>
<%@ page import="com.google.gson.Gson"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";

String theme = "metro";
UserContext uCtx = (UserContext) session.getAttribute("uCtx");
if (uCtx == null) {

} else if (uCtx.getLogin() != null && uCtx.getLogin().getPerson() != null) {
	//UserPerson up = (UserPerson) uCtx.getLogin().getPerson(); 
	UserProcessor process = new UserProcessor();
	UserPerson person = process.refreshUserPerson((UserPerson) uCtx.getLogin().getPerson());
	uCtx.getLogin().setPerson(person);
}
System.out.println("displayName: " + application.getServletContextName());
System.out.println("uCtx: "+uCtx);
%>

<!DOCTYPE html">
<html>
<head>
<base href="<%=basePath%>">
<title></title>
<link rel="stylesheet" type="text/css" href="<%=path%>/libs/themes/<%=theme%>/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/libs/themes/icon.css">
<style type="text/css">
body {
	font-family: sans-serif, Helvetica, Verdana;
	font-size: 11px;
	margin: 0px;
}
.icon-menu{ background: url("<%=path%>/res/icons/genea_icon_20.png") no-repeat center center; }

</style>

<script type="text/javascript" src="<%=path%>/libs/jquery-1.9.1.js"></script>
<script type="text/javascript" src="<%=path%>/libs/jquery.easyui.min.js"></script>
<script type="text/javascript">
$(document.body).ready(function() {});
</script>
</head>
<body class="easyui-layout">
    <div id="topPanel" data-options="region:'north',border:false" style="height:50px; background-color:#ececec; padding: 10px; overflow: hidden;">
        <table>
	        <tr>
		        <td style="width: 100%">
			        <div style='padding:0px;font-size: 20px;color: #666'>Acies Genea 2014</div>
		        </td>
                <td>
				   <div style="padding:0px;">
				        <a id="modulMenuBtn" href="javascript:void(0);" class="easyui-menubutton"></a>
				        <script type="text/javascript">
						$("#modulMenuBtn").menubutton({
							menu: "#modulMenu",
							iconCls: "icon-menu"
						});
				        </script>
				    </div>
				    <div id="modulMenu" style="width:150px;">
				        <div id="MN.R.000001">Rodokmen</div>
				        <div class="menu-sep"></div>
				        <div id="MN.R.000002">Uživatel</div>
				    </div>
				    <script type="text/javascript">
                    $("#modulMenu").menu({
                        onClick: function(item) {
                        	var url = "/genea/pages/desktop_ajax.jsp?processId=loadModul&modulId="+item.id;
                        	$("#modulTabs").panel("refresh", url);
                            $("#modulTabs").panel({ fit: true, title: ""+item.text });
                    		$("#modulTabs").css({ "overflow": "hidden" });
                            //addPanel(item.id, item.text);
                        }
                    });
                    </script>				        
                </td>		        
	        </tr>
        </table>
    </div>
    <div id="modulTabs" data-options="region:'center',title:'Welcome',border:true" style="padding: 0px;"></div>
    
    <div id="tab-tools">
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-reload'"></a>
    </div>
    <script type="text/javascript">
    </script>
</body>
</html>
